﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<%@ Import Namespace="CRM.Resourses" %>






<% Html.DevExpress().GridView(settings =>
                                    {
                                        settings.Name = "gdLegalEntities";
                                        settings.KeyFieldName = "IdLegalEntity";
                                        settings.CallbackRouteValues =
                                            new {Controller = "Customers", Action = "FullLegalEntitiesListPartial"};
                                        settings.SettingsPager.PageSize = 20;

                                        settings.Settings.ShowGroupPanel = true;
                                        settings.Settings.ShowFilterRow = true;

                                        //settings.StylesFilterControl=

                                        settings.Width = Unit.Percentage(100);

                                        settings.Columns.Add(column =>
                                                                 {
                                                                     column.Caption = "Юр. лицо";
                                                                     column.FieldName = "IdCustomer";
                                                                     // column.
                                                                     column.ColumnType =
                                                                         MVCxGridViewColumnType.HyperLink;
                                                                     column.Settings.FilterMode =
                                                                         ColumnFilterMode.DisplayText;
                                                                     column.Settings.AutoFilterCondition =
                                                                         AutoFilterCondition.Contains;
                                                                     HyperLinkProperties properties =
                                                                         column.PropertiesEdit as HyperLinkProperties;
                                                                     String urlFormatString =
                                                                         Url.Action("Details", "Customers",
                                                                                    new RouteValueDictionary(
                                                                                        new {id = "{0}"}));

                                                                     properties.NavigateUrlFormatString =
                                                                         HttpUtility.UrlDecode(urlFormatString);
                                                                     properties.TextField = "Name";

                                                                 });

                                        settings.Columns.Add(column =>
                                                                 {
                                                                     column.Caption = "Номер юр лица в САП";
                                                                     column.FieldName = "NumberInSAP";
                                                                 });

                                        settings.Columns.Add(column =>
                                                                 {
                                                                     column.Caption = "Клиент";
                                                                     column.FieldName = "CustomerName";
                                                                 });

                                        settings.Columns.Add(column =>
                                                                 {
                                                                     column.Caption = "Номер клиента в САП";
                                                                     column.FieldName = "CustomerSAPNumber";
                                                                 });


                                        settings.Columns.Add(column =>
                                                                 {
                                                                     column.Caption = Resourses.CustomerNumber;
                                                                     column.FieldName = "SequentialNumber";
                                                                 });

                                    })  
                                        
.Bind(Model).GetHtml();%>